package 多线程.Runnable;

import 多线程.Dog;

public class Mytest01 {
    public static void main(String[] args) throws InterruptedException {
        Dog d2 = new Dog("旺财");
        MyThread myThread = new MyThread();
        Thread thread = new Thread(myThread);

        thread.setName("一号现场");
        System.out.println(thread.getName());
        thread.start();
        thread.setPriority(1);


        d2.run();
//        Thread t = new Thread(() -> {
//            System.out.println("hello");
//        });
//        System.out.println("start");
//        t.start();
//        t.join();//join(long)的重载方法也可以指定一个等待时间，超过等待时间后就不再继续等待。
//        System.out.println("end");

    }
}
